/*************************************************************************
	> File Name: P2708.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-01-10 10:51:10
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    string str;
    cin >> str;
    int sum = 0;
    for (int i = 0; i < str.size() - 1; i++) {
        if (str[i] != str[i + 1]) sum += 1;
    }
    if (str[str.size() - 1] == '0') sum += 1;
    cout << sum << endl;
    return 0;
}
